<?php
	include_once 'config/common.php';
	include_once 'alipay/alipay.config.php';
	
	parse_str(file_get_contents("php://input"),$post);
   
	$apic = newInstance('service');
	$apic->log($_POST);
	$code = $apic->validate_user($_POST);
	
	$apic->log($code);
    
	if($code == '0'){
		if($_POST['c'] && $_POST['a']){
			$class = newInstance($_POST['c']);
			if($_POST['c'] == 'alipay'){
				$class->setConfig($alipay_config);
			}
			$param = json_decode($_POST['param'],true);
			if(!is_array($param)) $param = array();
			
			$data = $class->$_POST['a']($param);
		}
	}
	echo $r = $apic->result($data,$code);
	$apic->log($r);

	
?>